package function

import java.io.{File, FileWriter, PrintWriter}
import java.text.SimpleDateFormat
import java.util.Date

object FileIO2 {
  def main(args: Array[String]): Unit = {
    val a="测试"
    val b="test"

    val simpdate = new Date()
    val simpleDateFormattime = new SimpleDateFormat("yyyy-MM-dd")
    val str: String = simpleDateFormattime.format(simpdate)
    val writer = new PrintWriter(new FileWriter(s"F:\\ComputeDb\\DEV\\logs\\${str}.log",true))
    writer.write(s"写入日期：${new Date()}，写入了：${a}\n" +
      s"${b}\n")
    writer.close()

  }
}
